package two_shang._10_19;

public class Company {
    public static class Employee {
        String name, level;
        double salary;
        double more, base;

        public void setName(String name) {
            this.name = name;
        }

        public void setLevel(String level) {
            this.level = level;
        }

        void ComputeSalary() {
            salary = more + base;
        }
    }

    public static class Manager extends Employee {
        public void ComputeSalary() {
            base = 10000;
            more = 0;
            super.ComputeSalary();
            System.out.println(level + name + "的月工资为" + salary);
        }
    }

    public static class Salesman extends Employee {
        public void ComputeSalary() {
            base = 5000;
            more = 2000;
            super.ComputeSalary();
            System.out.println(level + name + "的月工资为" + salary);
        }
    }

    public static class Worker extends Employee {
        public void ComputeSalary() {
            base = 3000;
            more = 0;
            super.ComputeSalary();
            System.out.println(level + name + "的月工资为" + salary);
        }
    }
}
